﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ElementumForever.Interfaces;

namespace ElementumForever.CommandPattern
{
    class ChangeNameCommand : ICommand
    {
        IEntityProperty entity;
        string oldName, newName;

        public ChangeNameCommand(IEntityProperty entity,string oldName,string newName) {
            this.entity = entity;
            this.oldName = oldName;
            this.newName = newName;
        }

        public void Execute(IsceneBuilder modeler)
        {
            entity.Name = newName;
        }

        public void UnExecute(IsceneBuilder modeler)
        {
            entity.Name = oldName;
        }
    }
}
